package com.huatai.datacenter.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huatai.common.api.R;
import com.huatai.datacenter.entity.WordRequestLogEntity;
import com.huatai.datacenter.service.WordRequestLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * packageName com.huatai.datacenter.controller
 *
 * @author gaowengui
 * @version JDK 8
 * @className WordRequestLogController
 * @date 2025/7/1
 * @description TODO
 */
@RestController
@RequestMapping("/WordRequestLog")
@Api
public class WordRequestLogController {

    @Autowired
    private WordRequestLogService wordRequestLogService;

    @GetMapping("/page")
    @ApiOperation("分页查询请求日志")
    public R<Page<WordRequestLogEntity>> page(
            @ApiParam(value = "当前页码", defaultValue = "1")
            @RequestParam(defaultValue = "1") Integer current,
            @ApiParam(value = "每页条数", defaultValue = "10")
            @RequestParam(defaultValue = "10") Integer size){
        Page<WordRequestLogEntity> page = new Page<>(current, size);
        return R.data(wordRequestLogService.page(page));
    }
}
